# Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
cmake_minimum_required(VERSION 3.5.1)
project(DrawText)

set(PROJECT_SRC_ROOT ${CMAKE_CURRENT_LIST_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SRC_ROOT})
set(CMAKE_SKIP_BUILD_RPATH True)
add_compile_options(-std=c++11 -fPIE -fstack-protector-all -Wall -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-strict-aliasing -Wno-format-truncation)

# Find Header
set(HEADER_FILE_DIR
    ${PROJECT_SRC_ROOT}/
)
include_directories(${HEADER_FILE_DIR})
include_directories (/usr/include/freetype2)

# Find Src
file(GLOB_RECURSE SRC_FILE
    ${PROJECT_SRC_ROOT}/nv12_drawtxt.cpp
    ${PROJECT_SRC_ROOT}/Utils.cpp
)

set(SOURCE_FILE
    ${SRC_FILE}
)

# set the share library directory

# Set the target executable file
add_executable(drawtext ${SOURCE_FILE})

target_link_libraries(drawtext pthread m freetype -Wl,-z,relro,-z,now,-z,noexecstack -pie )
